package com.xzc.jcip._2_.线程安全性问题;

import net.jcip.annotations.NotThreadSafe;

import java.math.BigInteger;

/**
 * 竞态条件:read-then-write
 */
@NotThreadSafe
public class UnsafeCountingFactorizer {
    private long count = 0;

    public long getCount() {
        return count;
    }

    public void service() {
        ++count;
    }
}
